|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectguitools.Tools
public class Tools
Various tools for GUIs. Some are useful, others are... not useful unless you are laying out exactly as I do.
| Field Summary | |
|---|---|
static java.awt.Frame |
currentDialogOwner
Current dialog owner, handy global variable. |
static boolean |
FANCY_DIALOG
Apply a style to dialogs or not? |
static javax.swing.border.AbstractBorder |
gbBorder
Complete border around gridbagged panels. |
static javax.swing.border.AbstractBorder |
gbBorderNoMargin
No-bottom-margin border around gridbagged panels. |
static java.awt.Color |
LIGHT_SELECTION
A color between control and selection. |
| Constructor Summary | |
|---|---|
Tools()
|
|
| Method Summary | |
|---|---|
static void |
bindButtonsToComponent(java.awt.Component t,
javax.swing.AbstractButton enter,
javax.swing.AbstractButton esc)
Give the component a keylistener that responds to the keys ENTER and ESC and will 'press' the two buttons (can be null). |
static void |
bindButtonToList(javax.swing.JList list,
javax.swing.JButton btn)
Map double-clicking a list to a button fire. |
static void |
bindButtonToList(javax.swing.JList list,
javax.swing.JButton btn,
int nClick)
Map n-clicking a list to a button fire. |
static void |
borderize(javax.swing.JComponent b)
Apply fancy border and font to the component. |
static void |
borderize(javax.swing.JComponent b,
boolean includeSpace)
Apply fancy border and font to the component, with or without margin within the border. |
static void |
borderize(javax.swing.JComponent b,
java.awt.Color c)
Apply fancy border (color specified) and font to the component. |
static void |
borderize(javax.swing.JComponent b,
java.awt.Color c,
boolean includeSpace)
Apply fancy border (color specified) and font to the component, with or without margin within the border. |
static void |
buttonize(javax.swing.AbstractButton b)
Apply fancy layout to the button. |
static void |
buttonize(javax.swing.AbstractButton b,
java.awt.Color c)
Apply fancy layout to the button, with bordercolor specified. |
static void |
centerWindow(java.awt.Window w)
Center the window on screen. |
static void |
dialogize(javax.swing.JDialog d)
Create a really fancy dialog. |
static void |
font(javax.swing.JComponent b)
Give the component a nice font. |
static void |
fontBold(javax.swing.JComponent b)
Give the component a nice bold font. |
static int |
getScreenHeight()
Return height of the desktop in pixels. |
static int |
getScreenWidth()
Return width of the desktop in pixels. |
static javax.swing.ImageIcon |
loadIcon(java.lang.String fileName)
Load an icon. |
static javax.swing.JDesktopPane |
makeDesktop()
Make a desktop. |
static void |
makeInternalFrame(javax.swing.JInternalFrame f)
Make internal frame. |
static void |
makeMenu(javax.swing.JMenu m)
Prevent Swing from using, what, 200 different ugly fonts... |
static void |
makeMenuButton(javax.swing.AbstractButton but)
Make menu button. |
static void |
makeMenuButton(javax.swing.AbstractButton but,
boolean hover)
Make menu button with or without hovering effect. |
static void |
makeReadable(javax.swing.JComponent component,
java.awt.Color bgColor)
Update colour for component; adjust the foreground colour to something readable. |
static void |
print(double[] data)
Print array. |
static void |
print(java.lang.Object[] data)
Print array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.awt.Frame currentDialogOwner
public static boolean FANCY_DIALOG
public static java.awt.Color LIGHT_SELECTION
public static javax.swing.border.AbstractBorder gbBorderNoMargin
public static javax.swing.border.AbstractBorder gbBorder
| Constructor Detail |
|---|
public Tools()
| Method Detail |
|---|
public static int getScreenWidth()
public static int getScreenHeight()
public static void centerWindow(java.awt.Window w)
public static javax.swing.ImageIcon loadIcon(java.lang.String fileName)
public static void buttonize(javax.swing.AbstractButton b)
public static void buttonize(javax.swing.AbstractButton b,
java.awt.Color c)
public static void borderize(javax.swing.JComponent b)
public static void borderize(javax.swing.JComponent b,
java.awt.Color c)
public static void borderize(javax.swing.JComponent b,
boolean includeSpace)
public static void borderize(javax.swing.JComponent b,
java.awt.Color c,
boolean includeSpace)
public static void font(javax.swing.JComponent b)
public static void fontBold(javax.swing.JComponent b)
public static void bindButtonsToComponent(java.awt.Component t,
javax.swing.AbstractButton enter,
javax.swing.AbstractButton esc)
public static void bindButtonToList(javax.swing.JList list,
javax.swing.JButton btn)
public static void bindButtonToList(javax.swing.JList list,
javax.swing.JButton btn,
int nClick)
public static void dialogize(javax.swing.JDialog d)
public static void print(java.lang.Object[] data)
public static void print(double[] data)
public static void makeReadable(javax.swing.JComponent component,
java.awt.Color bgColor)
public static void makeMenu(javax.swing.JMenu m)
public static void makeMenuButton(javax.swing.AbstractButton but)
public static void makeMenuButton(javax.swing.AbstractButton but,
boolean hover)
public static void makeInternalFrame(javax.swing.JInternalFrame f)
public static javax.swing.JDesktopPane makeDesktop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||